//
//  WYCommissionCell.m
//  CirclePush
//
//  Created by admin on 2018/4/19.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYCommissionCell.h"
@interface WYCommissionCell()
@property (strong, nonatomic) IBOutlet UILabel *orderLabel;
@property (strong, nonatomic) IBOutlet UILabel *timeLabel;

@property (strong, nonatomic) IBOutlet UILabel *priceLabel;


@end
@implementation WYCommissionCell

-(void)setModel:(WYExtractModel *)model
{
    _model = model;
    
    self.priceLabel.text = [NSString stringWithFormat:@"%d",model.commission.intValue/100];
    self.orderLabel.text = [NSString stringWithFormat:@"订单%@",model.mediaOddNumber];
    self.timeLabel.text = [NSString stringWithFormat:@"返佣时间：%@",[self creatTimeForTimeInterval:model.createTime]];
    
    
}
-(NSString *)creatTimeForTimeInterval:(NSString *)timeInterVal
{
    //NSString *timeStampString  = orderMessage.waitTime;
    // iOS 生成的时间戳是10位
    NSTimeInterval interval    =[timeInterVal doubleValue] / 1000.0;
    NSDate *date               = [NSDate dateWithTimeIntervalSince1970:interval];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSString *TempString       = [formatter stringFromDate: date];
    return TempString;
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
